from django.db import models
from utils.BaseModel import BaseModel


# Create your models here.
class Nav(BaseModel):  # 导航栏
    name = models.CharField(max_length=10, verbose_name='导航栏名称')
    position = models.IntegerField(verbose_name='导航栏位置', default=0)  #0 头  1 尾
    link = models.CharField(max_length=100, verbose_name='导航栏链接', default='')

    class Meta:
        db_table = 'fgnav'

    def __str__(self):
        return self.name


class Banner(BaseModel):  # 轮播图
    title = models.CharField(max_length=100, verbose_name='标题')
    imgurl = models.CharField(max_length=100,verbose_name='图片')
    link = models.CharField(max_length=100, verbose_name='链接', default='')

    class Meta:
        db_table = 'fgbanner'

    def __str__(self):
        return self.title
